/******************************************************************************

	COPYRIGHT(C) JONAS 'SORTIE' TERMANSEN 2010.

	This file is part of the Maxsi Library.

	Maxsi Library is free software: you can redistribute it and/or modify it
	under the terms of the GNU Lesser General Public License as published by
	the Free Software Foundation, either version 3 of the License, or (at your
	option) any later version.

	Maxsi Library is distributed in the hope that it will be useful, but
	WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
	or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
	License for more details.

	You should have received a copy of the GNU Lesser General Public License
	along with Maxsi Library. If not, see <http://www.gnu.org/licenses/>.

	Maxsi Library
	A powerful Cross-Platform C++ General Purpose Library that allows you to
	efficiently create high-performance and reliable applications.

	MaxsiTranslate.h
	A system for loading string table files and storing them in memory, so
	that when any parts of the application needs to be localized, strings can
	be easily localized using the Translate() function.

******************************************************************************/

#ifndef MaxsiTranslate_H
#define MaxsiTranslate_H

BeginMaxsiNamespace

MAXSI_STRUCTLINK MaxsiTranslateLanguage
{
	MESTR* Language;
	MESTR* StringTableName;
	MESTR** StringTable;
	size_t NumStrings;
};

MAXSI_LINK MaxsiError LoadMaxsiComponentConfiguration(MESTR* ComponentName);
MAXSI_LINK MaxsiError UnloadMaxsiComponentsConfigurations();

MAXSI_LINK MESTR* LookUpTranslation(MESTR* StringName);
MAXSI_LINK size_t AddStringTable(MESTR* Language, MESTR* StringTableName);
MAXSI_LINK MaxsiError LoadLanguageFile(MESTR* Language, MESTR* StringTableName);
MAXSI_LINK MaxsiError ParseLanguageFile(MESTR* Language, MESTR* StringTableName, MESTR* Data, size_t DataLength, size_t* NumStrings = NULL);

#define Translate(String) LookUpTranslation(_MESTR(String))

EndMaxsiNamespace

#endif
